package com.wx.chapter12.exception_;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/6/16 - 11:09
 */
public class ClassCastException_ {
    public static void main(String[] args) {
        A b = new B();//向上转型
        B b2 = (B) b;//向下转型
        if (b instanceof B) {
            System.out.println(true);
        }
        C c = (C) b;
    }
}

class A {
}

class B extends A {
}

class C extends A {
}